unit nncrypt32;

interface

uses
  SysUtils, Classes;
  
type
  TCipherType = (ctBlowFish, ctCast128, ctCast256, ctDes, ct3Des, ctGost, ctIce, ctThinIce,
                 ctIce2, ctIdea, ctMars, ctMisty1, ctRC2, ctRC4, ctRC5, ctRC6, ctRijndael,
                 ctSerpent, ctTea, ctTwoFish);

  THashType = (htHaval, htMD4, htMD5, htRipemd128, htRipemd160, htSHA1, htSHA256, htSHA384,
               htSHA512, htTiger);
			   
{$IFNDEF WINDOWS}
  function EncryptString(AKeyString, AStr: WideString; ACipher: TCipherType;
    AHash: THashType): WideString; stdcall; external 'nncrypt32.dll';

  function DecryptString(AKeyString, AStr: WideString; ACipher: TCipherType;
    AHash: THashType): WideString; stdcall; external 'nncrypt32.dll';

  function EncryptFile(AKeyString, ASource, ADest: WideString; ACipher: TCipherType;
    AHash: THashType): Boolean; stdcall; external 'nncrypt32.dll';

  function DecryptFile(AKeyString, ASource, ADest: WideString; ACipher: TCipherType;
    AHash: THashType): Boolean; stdcall; external 'nncrypt32.dll';

  function MD5String(AStr: WideString; var ACheckSum): Integer; stdcall;
    external 'nncrypt32.dll';

  function MD5File(ASource: WideString; var ACheckSum: WideString): Integer; stdcall;
    external 'nncrypt32.dll';
{$ELSE}
{$IFNDEF LINUX}
  function EncryptString(AKeyString, AStr: WideString; ACipher: TCipherType;
    AHash: THashType): WideString; stdcall; external 'nncrypt32.so';

  function DecryptString(AKeyString, AStr: WideString; ACipher: TCipherType;
    AHash: THashType): WideString; stdcall; external 'nncrypt32.so';

  function EncryptFile(AKeyString, ASource, ADest: WideString; ACipher: TCipherType;
    AHash: THashType): Boolean; stdcall; external 'nncrypt32.so';

  function DecryptFile(AKeyString, ASource, ADest: WideString; ACipher: TCipherType;
    AHash: THashType): Boolean; stdcall; external 'nncrypt32.so';

  function MD5String(AStr: WideString; var ACheckSum): Integer; stdcall;
    external 'nncrypt32.so';

  function MD5File(ASource: WideString; var ACheckSum: WideString): Integer; stdcall;
    external 'nncrypt32.so';
{$ENDIF}
{$ENDIF}

implementation

end.